# Genetic Algorithm for thesis of Moos Hueting
# v0.1a
cmake_minimum_required(VERSION 2.8)
project( GA )

# configuration for FFTW3
# we need the FindFFTW3.cmake file
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules/")
find_package( FFTW3 REQUIRED )

include_directories(${FFTW3_INCLUDE_DIRS})
set(LIBS ${LIBS} ${FFTW3_LIBRARIES})

# configuration for fftw++
include_directories("${PROJECT_SOURCE_DIR}/fftw++")
add_subdirectory(fftw++)

# configuration for Boost
set(Boost_USE_STATIC_LIBS        ON)
set(Boost_USE_MULTITHREADED      ON)
set(Boost_USE_STATIC_RUNTIME    OFF)

find_package( Boost )

include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

# configuration for OpenCV
find_package( OpenCV REQUIRED )

# executables
add_executable( ga test.cpp geneticAlgorithm.cpp complexity.cpp connectedComponents.cpp )
target_link_libraries( ga ${OpenCV_LIBS} )
add_executable( testfft testfft.cpp )
target_link_libraries( testfft FFTWPP ${LIBS} )

# different build types
if(CMAKE_BUILD_TYPE MATCHES Release)
    set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
endif(CMAKE_BUILD_TYPE MATCHES Release)
if(CMAKE_BUILD_TYPE MATCHES Debug)
    set(CMAKE_CXX_FLAGS "-g -Wall -Wextra")
endif(CMAKE_BUILD_TYPE MATCHES Debug)
